.news-add {
  padding: 0 20px;
  
  .news-steps {
    margin-bottom: 24px;
  }
  
  .content-container {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    
    .preview-mode {
      width: 65%;
    }
    
    .preview-sidebar {
      width: 35%;
    }
  }
  
  .steps-content {
    margin-bottom: 24px;
    padding: 20px;
    
    &.hidden-content {
      display: none;
    }
    
    &.show-content {
      display: block;
    }
  }
  
  .news-form {
    .cover-uploader {
      .cover-preview {
        padding: 8px;
        img {
          max-width: 100%;
          max-height: 200px;
          object-fit: contain;
        }
      }
    }
  }
  
  .preview-content {
    padding: 10px;
    
    .preview-title {
      font-size: 24px;
      font-weight: bold;
      margin-bottom: 16px;
    }
    
    .preview-meta {
      display: flex;
      gap: 16px;
      color: #666;
      margin-bottom: 16px;
      font-size: 14px;
    }
    
    .preview-cover {
      text-align: center;
      margin: 16px 0;
      
      img {
        max-width: 100%;
        max-height: 300px;
        object-fit: contain;
      }
    }
    
    .preview-body {
      p {
        margin-bottom: 1em;
        font-size: 16px;
        line-height: 1.6;
      }
      
      img {
        max-width: 100%;
        height: auto;
      }
    }
  }
  
  .steps-action {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    
    .submit-actions {
      display: flex;
      gap: 16px;
    }
    
    .prev-btn {
      margin-right: auto;
    }
  }
  
  .auto-save-indicator {
    color: #52c41a;
    font-size: 14px;
    display: flex;
    align-items: center;
    
    &:before {
      content: "";
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background-color: #52c41a;
      margin-right: 6px;
      animation: pulse 1.5s infinite;
    }
  }
}

.news-draft {
  padding: 20px;
  
  h2 {
    margin-bottom: 20px;
    color: #1890ff;
  }
}

.news-preview {
  padding: 20px;
  
  .title {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
  }
  
  .info {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #777;
    
    span {
      padding: 0 10px;
    }
  }
  
  .content {
    margin-top: 20px;
    padding: 0 20px;
  }
}

.news-category {
  padding: 20px;
  
  .editable-cell-value-wrap {
    padding: 5px 12px;
    cursor: pointer;
    min-height: 32px;
    line-height: 32px;
    
    &:hover {
      border: 1px solid #d9d9d9;
      border-radius: 4px;
      padding: 4px 11px;
    }
  }
}

.error-message {
  padding: 20px;
  text-align: center;
  color: #f5222d;
  background-color: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 4px;
  margin: 20px;
  font-size: 16px;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
}

.news-update {
  padding: 0 20px;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

.news-editor {
  .quill {
    min-height: 350px;
    
    .ql-editor {
      min-height: 300px;
      font-size: 16px;
      line-height: 1.6;
    }
  }
  
  .news-editor-tips {
    margin-top: 8px;
    color: #999;
    font-size: 12px;
    text-align: right;
  }
}

@media (max-width: 768px) {
  .news-add {
    .content-container {
      flex-direction: column;
      
      .preview-mode,
      .preview-sidebar {
        width: 100%;
      }
    }
    
    .news-form {
      .ant-form-item-label {
        flex: 0 0 100px;
      }
    }
  }
}

/* 新闻相关页面通用样式 */
.news-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  
  /* 页面标题区域 */
  .page-header {
    margin-bottom: 16px;
    flex-shrink: 0;
  }
  
  /* 新闻卡片容器 */
  .news-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    padding: 20px;
    
    .ant-card-body {
      display: flex;
      flex-direction: column;
      padding: 24px;
      height: 100%;
    }
  }
  
  /* 步骤条容器 */
  .steps-container {
    margin-bottom: 24px;
    flex-shrink: 0;
  }
  
  /* 每个步骤的内容容器 */
  .step-content-container {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 320px); /* 限制高度，确保底部按钮可见 */
    margin-bottom: 24px;
    padding: 0 5px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    
    /* 基本信息步骤 */
    &.basic-info-form {
      padding: 20px;
    }
    
    /* 编辑器步骤 */
    &.editor-step-container {
      display: flex;
      flex-direction: column;
      padding: 0;
      
      .news-editor {
        height: 100%;
        border: none;
      }
    }
    
    /* 预览步骤 */
    &.preview-step-container {
      padding: 10px;
      
      .preview-card {
        border: none;
        box-shadow: none;
        
        .ant-card-body {
          padding: 10px;
        }
        
        .preview-title {
          font-size: 24px;
          font-weight: bold;
          text-align: center;
          margin-bottom: 24px;
        }
        
        .news-preview-content {
          font-size: 16px;
          line-height: 1.8;
          
          img {
            max-width: 100%;
            height: auto;
            margin: 16px auto;
            display: block;
          }
          
          p {
            margin-bottom: 16px;
          }
          
          h1, h2, h3, h4, h5, h6 {
            margin: 24px 0 16px;
            font-weight: bold;
          }
          
          ul, ol {
            margin-left: 20px;
            margin-bottom: 16px;
          }
          
          blockquote {
            padding-left: 16px;
            border-left: 4px solid #d9d9d9;
            color: #666;
            font-style: italic;
            margin: 16px 0;
          }
        }
      }
    }
  }
  
  /* 底部操作区域 */
  .bottom-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    margin-top: auto;
    
    .left-actions {
      display: flex;
      gap: 8px;
    }
    
    .right-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    
    .auto-save-indicator {
      display: flex;
      align-items: center;
      color: #52c41a;
      margin-right: 16px;
      
      &:before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #52c41a;
        display: inline-block;
        margin-right: 6px;
        animation: pulse 1.5s infinite;
      }
    }
  }
  
  /* 动画效果 */
  @keyframes pulse {
    0% {
      opacity: 1;
    }
    50% {
      opacity: 0.4;
    }
    100% {
      opacity: 1;
    }
  }
}

/* 新闻分类管理页面 */
.category-management {
  .ant-table-wrapper {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
  }
  
  .action-buttons {
    display: flex;
    gap: 8px;
  }
}

/* 草稿箱页面 */
.draft-list {
  .ant-table-wrapper {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .news-container {
    .news-content-scroll-area {
      max-height: calc(100vh - 200px);
      
      .editor-scroll-container {
        max-height: calc(100vh - 300px);
      }
    }
    
    .news-list .ant-table-wrapper,
    .category-management .ant-table-wrapper,
    .draft-list .ant-table-wrapper {
      max-height: calc(100vh - 240px);
    }
  }
} 